home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
nrpas13.zip
/
CHSONE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-04-29
|
537b
|
20 lines
PROCEDURE chsone(bins,ebins: barray; nbins,knstrn: integer;
VAR df,chsq,prob: real);
(* Programs using routine CHSONE must define the types
TYPE
barray = ARRAY [1..nbins] OF real;
in the main routine. *)
VAR
j: integer;
BEGIN
df := nbins-1-knstrn;
chsq := 0.0;
FOR j := 1 TO nbins DO BEGIN
IF (ebins[j] <= 0.0) THEN BEGIN
writeln('pause in CHSONE - bad expected number')
END;
chsq := chsq+sqr(bins[j]-ebins[j])/ebins[j]
END;
prob := gammq(0.5*df,0.5*chsq)
END;